# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem              1.0

name                    OCPN_libpng
version                 1.6.37
revision                0
checksums               rmd160  7d68b596480e994aeccb2794df48a3613f1de9c4 \
                        sha256  505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca \
                        size    1012272

set branch              [join [lrange [split ${version} .] 0 1] ""]
categories              graphics
maintainers             {ryandesign @ryandesign}
license                 zlib
platforms               darwin openbsd freebsd sunos linux
homepage                http://www.libpng.org/pub/png/libpng.html
use_xz                  yes

description             Library for manipulating PNG images

long_description        Libpng was written as a companion to the PNG \
                        specification, as a way to reduce the amount of time \
                        and effort it takes to support the PNG file format in \
                        application programs. Most users will not have to \
                        modify the library significantly, advanced users may \
                        want to modify it more. The library was coded for \
                        both users. All attempts were made to make it as \
                        complete as possible, while keeping the code easy to \
                        understand. Currently, this library only supports C. \
                        Support for other languages is being considered.

master_sites            sourceforge:project/libpng/libpng${branch}/${version} \
                        ftp://ftp.simplesystems.org/pub/libpng/png/src/${name}${branch}/

distname                libpng-1.6.37

depends_lib             port:zlib

patchfiles-append       libpng.pc.in.patch

configure.cflags-append  "-mmacosx-version-min=10.9"

configure.args          --enable-intel-sse=no

use_parallel_build      yes

test.run                yes
test.target             check

post-destroot {
    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}/examples
    xinstall -m 0644 -W ${worksrcpath} \
        ANNOUNCE \
        CHANGES \
        LICENSE \
        README \
        TODO \
        ${destroot}${docdir}
    xinstall -m 0644 ${worksrcpath}/example.c ${destroot}${docdir}/examples
}

livecheck.type          regexm
livecheck.regex         {Current.+?(?:version|release).+?<B>(?:libpng )?([0-9.]+)</B>}
